import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'Home',
      component: () => import('../views/home/home.vue'),
      comment: '主页'
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/user/login.vue'),
      meta: {
        isAuthPage: true // 标记这是认证页面
      }
    },
    {
      path: '/profile',
      name: 'Profile',
      component: () => import('../views/user/profile.vue'),
      comment: '个人中心'
    },
    {
      path: '/guides',
      name: 'Guides',
      component: () => import('../views/guides/guides.vue'),
      comment: '攻略中心'
    },
    {
      path: '/guides/article/:id',
      name: 'GuidesArticle',
      component: () => import('../views/guides/article.vue'),
      comment: '帖子详情页面'
    },
    {
      path: '/community',
      name: 'Community',
      component: () => import('../views/community/community.vue'),
      comment: '社区讨论页面'
    },
    {
      path: '/community/article/:id',
      name: 'CommunityArticle',
      component: () => import('../views/community/article.vue'),
      comment: '帖子详情页面'
    },
    {
      path: '/community/post',
      name: 'Post',
      component: () => import('../views/post/post.vue'),
      comment: '发帖页面'
    },
    {
      path: '/wiki',
      name: 'Wiki',
      component: () => import('../views/wiki/wiki.vue'),
      comment: '资料库'
    },
    {
      // path: '/wiki/encyclopedia:id',
      path: '/wiki/encyclopedia',
      name: 'Encyclopedia',
      component: () => import('../components/wiki/encyclopedia.vue'),
      comment: '资料图鉴'
    },
    {
      // path: '/wiki/details/:id',
      path: '/wiki/details',
      name: 'details',
      component: () => import('../components/wiki/details.vue'),
      comment: '图鉴详情页'
    },
  ],
})

export default router


